"use client"

import * as React from "react"
import { AppRouterCacheProvider } from "@mui/material-nextjs/v15-appRouter"
import { ThemeProvider } from "@mui/material/styles"
import CssBaseline from "@mui/material/CssBaseline"
import { Toaster } from "react-hot-toast"
import theme from "../theme"

export default function ThemeRegistry({ children }: { children: React.ReactNode }) {
	return (
		<AppRouterCacheProvider>
			<ThemeProvider theme={theme}>
				<CssBaseline />
				{children}
				<Toaster
					position='top-right'
					toastOptions={{
						duration: 3000,
						style: {
							background: "#333",
							color: "#fff"
						}
					}}
				/>
			</ThemeProvider>
		</AppRouterCacheProvider>
	)
}
